<template>
  <div>
    <el-button @click="login1">发起请求（Post）</el-button>
    <el-button @click="login2">发起请求（Get 路径参数url/{id}）</el-button>
    <el-button @click="login3">发起请求（Get 查询参数url?name=）</el-button>
  </div>
</template>

<script>
import API from '@/api/login'
export default {
  name: 'requestMethods',
  data () {
    return {

    }
  },
  methods: {
    login1 () {
      API.login1('test').then(res => {

      }).catch(e => {
        this.$message.error(`error:${e.message}`)
      }).finally(() => {

      })
    },
    login2 () {
      API.login2('test').then(res => {

      }).catch(e => {
        this.$message.error(`error:${e.message}`)
      })
    },
    login3 () {
      API.login3('test').then(res => {

      }).catch(e => {
        this.$message.error(`error:${e.message}`)
      })
    }
  }
}
</script>

<style lang="less" scoped>
</style>
